﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

using Framework.Graphics;
using Framework.Graphics.Light.Shadow;
using Framework.GameStateManagment;
using Framework.GameObjectManagment;
using Framework.GameObjectManagment.GameObjects;

namespace Framework.Physics.ShootControl
{
    public class Shoot
    {
        private Vector2 _position;
        private Vector2 _movement;
        private Int32 _lifetime;
        private Texture2D _texture;
        private Int32 _typ;
        private Int32 _effectID;
        private bool _active;

        public Shoot()
        {
            _position = Vector2.Zero;
            _movement = Vector2.Zero;
            _lifetime = 100;


            // Default 
            _typ = 0;
            _effectID = 0;
            _active = true;
        }

        public Shoot(Vector2 startposition, Vector2 movement, Int32 lifetime, Texture2D texture)
        {
            _position = startposition;
            _movement = movement;
            _lifetime = lifetime;
            _texture = texture;

            // Default 
            _typ = 0;
            _effectID = 0;
            _active = true;
        }

        public bool Update()
        {
            _lifetime--;
            if (_lifetime <= 0)
            {
                _active = false;
            }
            return _active;
        }

        public void Draw(SpriteBatch sb)
        {
            sb.Draw(_texture, _position, Color.White);
        }

    }
}
